package cn.bdqn.service;

import cn.bdqn.pojo.SysUser;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import javax.annotation.Resource;

@RunWith(SpringRunner.class)
@SpringBootTest
public class UserServiceTester {
    @Resource
    SysUserService sysUserService;
//    @Resource
//    UserService userService;
//
//    @Test
//    public void test(){
//        User user=new User("张飞","lllll",1l,2);
//         userService.addUser(user);
//
//    }
//    @Test
//    public void test2(){
//        User user = userService.getUser(20l);
//        System.out.println(user.getUsrName());
//    }
//    @Test
//    public void test3(){
//        User user=new User(21l,"张飞2","lllll2",1l,2);
//        userService.updateUser(user);
//    }
//    @Test
//    public void test4(){
//         userService.deleteUser(21l);
//
//    }

    @Test
    public void test6(SysUser sysUser){
       sysUser.setUsrName("ssss");
       sysUser.setUsrId(20l);
        SysUser sys = sysUserService.update(sysUser);
        if (sys!=null){
            System.out.println("成功");
        }else{
            System.out.println("失败");
        }
    }
    @Test
    public void test7(Long id){
        int delete = sysUserService.delete(id);
        if (delete>1){
            System.out.println("成功");
        }else{
            System.out.println("失败");
        }
    }

}
